/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package kphoto.mc.testing;

import org.openide.util.NbBundle;
import org.openide.windows.TopComponent;
import org.openide.windows.WindowManager;
import org.netbeans.api.settings.ConvertAsProperties;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;

/**
 * Top component which displays something.
 */
@ConvertAsProperties(dtd = "-//kphoto.mc.testing//Testwindow//EN",
autostore = false)
@TopComponent.Description(preferredID = "TestwindowTopComponent",
//iconBase="SET/PATH/TO/ICON/HERE", 
persistenceType = TopComponent.PERSISTENCE_ALWAYS)
@TopComponent.Registration(mode = "editor", openAtStartup = true)
@ActionID(category = "Window", id = "kphoto.mc.testing.TestwindowTopComponent")
@ActionReference(path = "Menu/Window" /*, position = 333 */)
@TopComponent.OpenActionRegistration(displayName = "#CTL_TestwindowAction",
preferredID = "TestwindowTopComponent")
public final class TestwindowTopComponent extends TopComponent {

    public TestwindowTopComponent() {
        initComponents();
        setName(NbBundle.getMessage(TestwindowTopComponent.class, "CTL_TestwindowTopComponent"));
        setToolTipText(NbBundle.getMessage(TestwindowTopComponent.class, "HINT_TestwindowTopComponent"));
        putClientProperty(TopComponent.PROP_CLOSING_DISABLED, Boolean.TRUE);
        putClientProperty(TopComponent.PROP_DRAGGING_DISABLED, Boolean.TRUE);
        putClientProperty(TopComponent.PROP_UNDOCKING_DISABLED, Boolean.TRUE);

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        btnTestDocument = new javax.swing.JButton();
        lblOutput = new javax.swing.JLabel();

        org.openide.awt.Mnemonics.setLocalizedText(btnTestDocument, org.openide.util.NbBundle.getMessage(TestwindowTopComponent.class, "TestwindowTopComponent.btnTestDocument.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(lblOutput, org.openide.util.NbBundle.getMessage(TestwindowTopComponent.class, "TestwindowTopComponent.lblOutput.text")); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblOutput, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
                    .addComponent(btnTestDocument))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(btnTestDocument)
                .addGap(18, 18, 18)
                .addComponent(lblOutput)
                .addContainerGap(234, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnTestDocument;
    private javax.swing.JLabel lblOutput;
    // End of variables declaration//GEN-END:variables
    @Override
    public void componentOpened() {
        // TODO add custom code on component opening
    }

    @Override
    public void componentClosed() {
        // TODO add custom code on component closing
    }

    void writeProperties(java.util.Properties p) {
        // better to version settings since initial version as advocated at
        // http://wiki.apidesign.org/wiki/PropertyFiles
        p.setProperty("version", "1.0");
        // TODO store your settings
    }

    void readProperties(java.util.Properties p) {
        String version = p.getProperty("version");
        // TODO read your settings according to their version
    }
}
